// 发现promise 异步同步化缺点

function f1(){
return new Promise((resolve)=>{
    console.log('f1')
    setTimeout(resolve,2000)
})    
}


function f2(){
    return new Promise((resolve)=>{
        console.log('f2')
        setTimeout(resolve,2000)
    })  
}

function f3(){
    return new Promise((resolve)=>{
        console.log('f3')
        setTimeout(resolve,2000)
    })  
}

function f4(){
    return new Promise((resolve)=>{
        console.log('f4')
        setTimeout(resolve,2000)
    })  
}

function f5(){
    return new Promise((resolve)=>{
        console.log('f5')
        setTimeout(resolve,2000)
    })  
}

f1()
.then(()=>{
   return f2();
})
.then(()=>{
    return f3();
})
.then(()=>{
    return f4();
})
.then(()=>{
f5();
})